<script setup>
import { ref } from 'vue'
const person = ref({
  name: '张飒',
  age: 10
})
const changeName = () => {
  person.value.name = '李四'
}
const addAge = () => {
  person.value.age++
}
const car = ref('自行车')
const changeCar = () => {
  car.value = '小轿车'
}
</script>
<template>
  <div>
    {{ person }}
  </div>
  <button @click="addAge">增加年龄</button>
  <button @click="changeName">修改姓名</button>
  <br>
  <div>
    {{ car }}
  </div>
  <button @click="changeCar">换车</button>

</template>

<style scoped></style>
